package com.jingming.consult.view;

import android.os.AsyncTask;
import android.os.Handler;
import android.os.Message;

import androidx.annotation.NonNull;

import com.jingming.consult.base.BaseActivity;


public class Activityhandler extends BaseActivity {
    public Handler handler = new Handler() {
        @Override
        public void handleMessage(@NonNull Message msg) {
            super.handleMessage(msg);
        }
    };

    public static class MyAsyTask extends AsyncTask<String, Integer, String> {
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            //任务执行之前 UI操作
        }

        @Override
        protected String doInBackground(String... strings) {
            return null;
        }

        @Override
        protected void onProgressUpdate(Integer... values) {
            super.onProgressUpdate(values);
            //可以在主线程 更新任务进度
        }

        @Override
        protected void onPostExecute(String s) {
            super.onPostExecute(s);
            //返回结果
        }

        @Override
        protected void onCancelled() {
            super.onCancelled();
            //任务取消
        }
    }
}
